import { Navigate } from 'react-router-dom';

import NotFound from '@/components/NotFound';
import Auth from '@/pages/auth';
import Database from '@/pages/database';
import Home from '@/pages/home';
import Instructions from '@/pages/instructions';
import User from '@/pages/user';

import { MetaRouteObject } from './type';
import vulnerable from './vulnerable';

const routes: MetaRouteObject[] = [
  {
    path: '/',
    element: <Home />,
  },
  {
    path: '/instructions',
    element: <Instructions />,
  },
  {
    path: '/database',
    element: <Database />,
  },
  {
    path: '/user',
    element: <User />,
  },
  {
    path: '/auth',
    element: <Auth />,
  },
  ...vulnerable,
  {
    path: '/404',
    element: <NotFound />,
  },
  {
    path: '*',
    element: <Navigate to="/404" replace />,
  },
];

export default routes;
